using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Text;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Emlyn.Website.Articles;
using FreeTextBoxControls;

namespace Emlyn.Website.ArticlesPresentation
{
    public class PresentArticleTitleLink : PresentArticle
    {
        private string _navigateUrl;

        public string NavigateUrl
        {
            get { return _navigateUrl; }
            set { _navigateUrl = value; }
        }

        protected override void CreateChildControls()
        {
            base.CreateChildControls();

            Panel lpnl;
            HyperLink lhref;

            lpnl = new Panel();

            lhref = new HyperLink();
            lhref.Text = aArticle.ArticleName;
            lhref.NavigateUrl = NavigateUrl.Replace("%ArticleCode%", aArticle.ArticleCode);
            lhref.CssClass = CssClass + "ArticleName";

            lpnl.Controls.Add(lhref);

            Controls.Add(lpnl);
        }
    }
}
